package com.baichang.taoshunda.dao.impl;

import com.baichang.framework.dao.impl.BaseDaoImpl;
import com.baichang.framework.model.Page;
import com.baichang.taoshunda.dao.FeedBackDao;
import com.baichang.taoshunda.entity.Feedback;
import org.springframework.stereotype.Repository;

@Repository
public class FeedBackDaoImpl extends BaseDaoImpl<Feedback> implements FeedBackDao {

    /**
     * 查询
     *
     * @param nowPage
     * @param pageSize
     * @param checkUserName
     * @return
     */
    @Override
    public Page queryOpinion(int nowPage, int pageSize, String checkUserName) {
        String sql = "SELECT * FROM {table}";
        if (!checkUserName.equals("")) {
            sql += " WHERE user_name LIKE'%" + checkUserName + "%'";
        }
        sql += "  ORDER BY created DESC";
        return pageForBeanList(sql, nowPage, pageSize);
    }
}
